home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 142
/
Volume 142 Oct 17 2011 - Damaged.iso
/
Games
/
operation-graduates.swf
/
scripts
/
frame_41
/
DoAction_5.as
< prev
next >
Wrap
Text File
|
2011-10-17
|
2KB
|
82 lines
function spawnBlueball(xSpot)
{
var _loc1_ = enemyContainer.attachMovie("blueballer","enemy" + eConCount++,eConCount);
_loc1_.gotoAndStop(1);
_loc1_._x = xSpot;
_loc1_._y = (- _loc1_._height) / 2;
_loc1_.move = blueballMover;
_loc1_.Q1logic = baddyQ1;
_loc1_.Q2logic = baddyQ2;
_loc1_.Q3logic = baddyQ3;
_loc1_.Q4logic = baddyQ4;
_loc1_.hit = blueballHit;
_loc1_.collide = baddyCollide;
_loc1_.isHit = false;
_loc1_.energy = 25;
_loc1_.shoot = blueballShoot;
_loc1_.shootLeft = true;
_loc1_.shootTimer = 0;
}
function blueballHit()
{
var _loc1_ = this;
_loc1_.setRGB(16777215);
_loc1_.isHit = true;
_loc1_.energy -= 5;
if(_loc1_.energy <= 0)
{
playSound("sound.missile.explode");
explode(_loc1_);
addScore(300);
baddyKillCount++;
}
}
function blueballMover()
{
var _loc1_ = this;
if(_loc1_.isHit)
{
_loc1_.resetColor();
_loc1_.isHit = false;
}
_loc1_._y += 1;
_loc1_.shootTimer = _loc1_.shootTimer + 1;
if(_loc1_.shootTimer == 30)
{
_loc1_.shoot();
_loc1_.shootTimer = 0;
}
if(_loc1_._y - _loc1_._height / 2 > 400)
{
_loc1_.removeMovieClip();
}
}
function blueballShoot()
{
var _loc1_ = this;
var _loc2_ = eBullets.attachMovie("eBul2","bullet" + eBulletsCount++,eBulletsCount);
if(_loc1_.shootLeft)
{
_loc2_._x = _loc1_._x + -33;
_loc2_._y = _loc1_._y + 47;
_loc1_.gotoAndPlay("rightshot");
_loc1_.shootLeft = false;
}
else
{
_loc2_._x = _loc1_._x + 33;
_loc2_._y = _loc1_._y + 47;
_loc1_.gotoAndPlay("leftshot");
_loc1_.shootLeft = true;
}
_loc2_.onEnterFrame = function()
{
var _loc1_ = this;
_loc1_._y += 8;
if(_loc1_._x < 0 || _loc1_._x > 600 || _loc1_._y < 0 || _loc1_._y > 400)
{
_loc1_.removeMovieClip();
}
};
}